﻿Imports System.Collections.Generic
Imports Pop.Api.Response
Imports Pop.Api.Util

Namespace Pop.Api.Request

    ''' <summary>
    ''' 1.03 (初级)修改商品库存或价格
    ''' </summary>
    Public Class ModifyItemStockRequest
        Inherits PopRequest(Of ModifyItemStockResponse)

        ''' <summary>
        ''' 卖家QQ号
        ''' </summary>
        Public Property SellerUin As Nullable(Of Long)

        ''' <summary>
        ''' 商品编码
        ''' </summary>
        Public Property ItemCode As String

        ''' <summary>
        ''' 商品私有编码
        ''' </summary>
        Public Property ItemLocalCode As String

        ''' <summary>
        ''' 商品的库存id
        ''' </summary>
        Property StockId As Nullable(Of Long)

        ''' <summary>
        ''' 商品的商家自定义库存id
        ''' </summary>
        Property StockLocalCode As String

        ''' <summary>
        ''' 商品的库存属性串
        ''' </summary>
        Property StockAttr As String

        ''' <summary>
        ''' 商品的库存的价格
        ''' </summary>
        Property StockPrice As Nullable(Of Long)

        ''' <summary>
        ''' 商品的库存数量
        ''' </summary>
        Property StockCount As Nullable(Of Long)

        ''' <summary>
        ''' 商品的库存备注
        ''' </summary>
        Property StockRemark As String

        ''' <summary>
        ''' 是否修改库存编码
        ''' </summary>
        Property ModifyLocalCode As Nullable(Of Long)

        ''' <summary>
        ''' 需要修改的新库存编码
        ''' </summary>
        Property StockLocalCodeNew As String

        ''' <summary>
        ''' 需要修改的新商家编码
        ''' </summary>
        Property ItemLocalCodeNew As String

#Region "Overrides"

        Protected Overrides Function GetApiName() As String
            Return "item.modifyItemStock"
        End Function

        Protected Overrides Function GetParameters() As IEnumerable(Of KeyValuePair(Of String, String))
            Dim parameters As New PopDictionary
            parameters.Add("sellerUin", SellerUin)
            parameters.Add("itemCode", Me.ItemCode)
            parameters.Add("itemLocalCode", Me.ItemLocalCode)
            parameters.Add("stockId", Me.StockId)
            parameters.Add("stockLocalCode", Me.StockLocalCode)
            parameters.Add("stockAttr", Me.StockAttr)
            parameters.Add("stockPrice", Me.StockPrice)
            parameters.Add("stockCount", Me.StockCount)
            parameters.Add("stockRemark", Me.StockRemark)
            parameters.Add("modifyLocalCode", Me.ModifyLocalCode)
            parameters.Add("stockLocalCodeNew", Me.StockLocalCodeNew)
            parameters.Add("itemLocalCodeNew", Me.ItemLocalCodeNew)
            Return parameters
        End Function

        Protected Overrides Sub Validate()
            Me.SellerUin.ValidateRequired("sellerUin")
        End Sub

#End Region

    End Class
End Namespace